<template>
	<view class="date">
		<view class="d1">
			<u-button @click="clickshow" :text="text"></u-button>
			<u-icon name="arrow-right"></u-icon>
		</view>
		<u-line></u-line>
		<u-calendar :show="show" @confirm="date" @close="show=false"></u-calendar>
		<u-button type="primary" text="下一步" style="width: 100px;" @click="tonext"></u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:0,
				show:false,
				text:''
			}
		},
		onLoad(options) {
			this.id=options.id
		},
		methods: {
			clickshow(){
				this.show=true
			},
			date(e){
				this.text=e[0]
				this.show=false
			},
			tonext(){
				if(this.text===''){
					uni.showToast({
						title:'日期为空',
						icon:'error'
					})
					return
				}
				uni.navigateTo({
					url:'/pages/serve/bus/busdingdan/busdingdan?id='+this.id
				})
			}
		}
	}
</script>

<style lang="scss">
.d1{
	display: flex;
}
</style>
